* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #4CAF50;
    margin-bottom: 10px;
}

header p {
    color: #666;
}

header i {
    margin-right: 10px;
}

.chat-container {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-box {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.message {
    display: flex;
    margin-bottom: 20px;
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #e6f7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    font-size: 20px;
}

.message.user .avatar {
    background-color: #e6ffe6;
}

.bot .avatar {
    background-color: #5a8f7b;
    color: white;
}

.user .avatar {
    background-color: #4a6fa5;
    color: white;
}

.content {
    max-width: 70%;
    background-color: #f1f1f1;
    padding: 12px 16px;
    border-radius: 10px;
}

.message.user .content {
    background-color: #e6ffe6;
}

.bot .content {
    background-color: #e8f5e9;
    border-bottom-left-radius: 0;
}

.user .content {
    background-color: #e3f2fd;
    border-bottom-right-radius: 0;
    text-align: right;
}

.content p {
    line-height: 1.5;
}

.input-area {
    display: flex;
    padding: 15px;
}

textarea {
    flex: 1;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    font-size: 16px;
    resize: none;
    margin-right: 10px;
    outline: none;
    transition: border 0.3s;
}

textarea:focus {
    border-color: #5a8f7b;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button i {
    margin-right: 5px;
}

footer {
    margin-top: 20px;
    text-align: center;
    color: #777;
    font-size: 14px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 加载动画 */
.typing {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}

.typing span {
    height: 8px;
    width: 8px;
    background: #5a8f7b;
    display: block;
    border-radius: 50%;
    margin: 0 3px;
    animation: typing 1.2s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* 添加对AI回复中HTML元素的样式支持 */
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: #4a6fa5;
    font-weight: bold;
}

.content h1 { font-size: 1.6em; }
.content h2 { font-size: 1.4em; }
.content h3 { font-size: 1.2em; }
.content h4, .content h5, .content h6 { font-size: 1.1em; }

.content p {
    margin-bottom: 10px;
}

.content strong {
    font-weight: bold;
}

.content ul {
    margin-left: 20px;
    margin-bottom: 10px;
    list-style-type: disc;
}

.content li {
    margin-bottom: 5px;
}

.content br {
    display: block;
    margin: 5px 0;
    content: "";
}
